home *** CD-ROM | disk | FTP | other *** search
- /*
- ** File sharing header
- */
-
- #include <sys/types.h>
-
- #include "include/mui.h"
-
- #ifndef AMSTER_SHARE_H
- #define AMSTER_SHARE_H
-
-
- /* Events */
-
- #define SHARE_OPEN 0x7001
- #define SHARE_CLOSE 0x7002
- #define SHARE_ADD 0x7003
- #define SHARE_ADDDIR 0x7004
- #define SHARE_REMOVE 0x7005
- #define SHARE_LOAD 0x7006
- #define SHARE_LOADAS 0x7007
- #define SHARE_SAVE 0x7008
- #define SHARE_SAVEAS 0x7009
- #define SHARE_UPLOAD 0x7010
- #define SHARE_NOTIFYALL 0x7011
- #define SHARE_PLAY 0x7012
- #define SHARE_ADDFILE 0x7013
- #define SHARE_ADDFILEN 0x7014
- #define SHARE_SETDIR 0x7015
- #define SHARE_UPDCOUNT 0x7016
-
-
- /* Argument array for parsing sharing file */
-
- #define ARG_PATH 0
- #define ARG_MD5 1
- #define ARG_SIZE 2
- #define ARG_BITRATE 3
- #define ARG_FREQ 4
- #define ARG_TIME 5
- #define ARG_REQCOUNT 6
-
- extern BOOL sharechanged;
-
- typedef struct sharedata_struct {
- char title[256];
- char md5[33];
- unsigned long size;
- int bitrate, freq, time;
- int reqcount;
- } *sharedata, _sharedata;
-
-
- /* GUI elements */
-
- struct shdata {
- u_long *list, *stat;
- };
-
-
- /* Prototypes */
-
- MUIF share_dispatch(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);
- ULONG share_new(struct IClass *cl, Object *obj, struct opSet *msg);
- MUIF sharelistdest(REG(a2) APTR pool, REG(a1) sharedata sd);
- MUIF sharelistdisp(REG(a2) char **array, REG(a1) sharedata sd);
- MUIF sharelistcomp(REG(a0) struct Hook *hook, REG(a2) Object *obj, REG(a1) struct NList_CompareMessage *ncm);
- MUIF ShareListAppMsgFunc(REG(a2) APTR obj, REG(a1) struct AppMessage **x);
-
- /* Private */
-
- void add_filename(struct shdata *data, char *fname);
- void add_file(struct shdata *data, song sdl, char *fname);
- void add_shares(struct shdata *data);
- void add_directory(struct shdata *data);
- void add_recursive(struct shdata *data, sharedata sd, BPTR dirlock, const char *dirname);
- void add_shareinfo(struct shdata *data, sharedata sd, BPTR lock);
- void notify_shares(struct shdata *data);
- void remove_shares(struct shdata *data, long t);
- void save_shares(struct shdata *data);
- void save_shares_as(struct shdata *data);
- void load_shares(struct shdata *data);
- void load_shares_as(struct shdata *data);
- void update_stat(struct shdata *data);
- void play_share(struct shdata *data);
-
- void upload_req(char *user, char *fname);
- void upload_file_confirm(struct shdata *data, char *user, char *fname);
-
- void update_count(struct shdata *data, char *fname);
-
- void nap_notifyshare(sharedata sd);
-
- BOOL IsIn(char *string, char c);
-
- /* Public prototypes */
-
- extern char *strrep(char *str1, char *old_str, char *new_str);
- extern char *MakeWinPath(char *AmigaPath);
-
-
- #endif /* AMSTER_SHARE_H */
-